package com.woniuxy.sender;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @Author: 曾令忠
 * @Description:
 * @Date: 2020/7/7 0007-上午 11:24
 */
@Component
public class DelaySender {
    @Autowired
    RabbitTemplate rabbitTemplate;
    public void send(String msg){
        System.out.println("生产者发送消息："+new Date());
        rabbitTemplate.convertAndSend("delay_exchange","delay",msg);
    }
}
